#include "ConfigTest.h"
#include <ooputils/Config.h>
#include <ooputils/ConfigManager.h>
#include <iostream>

using namespace std;
using namespace OOPUtils;


ConfigTest::ConfigTest(void)
{
}


ConfigTest::~ConfigTest(void)
{
}

void ConfigTest::test ()
{
	ConfigManager configMng = ConfigManager::getSingleton ();
	configMng.setBasePath (L"..\\TestData\\");
	OOPPtr< Config > pConfig = configMng.load (L"config_test.txt");
	int test1 = OOPString::convertTo< int > ((*pConfig)[L"Test1"]);
	double test2 = OOPString::convertTo< double > ((*pConfig)[L"Test2"]);
	cout << "Test1 = " << test1 << endl;
	cout << "Test2 = " << test2 << endl;
	test2 = 10000;
	(*pConfig)[L"NewProperty"] = L"related_config_test.txt";
	configMng.save (pConfig, L"config_test_output.txt");
}